<html>
<head>
<title>
管理后台
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel='stylesheet' type="text/css" href="../extjs-4.1.0/resources/css/ext-all-gray.css"/>
<link rel="shortcut icon" href="../images/favicon.ico" >
<style type='text/css'>
.info{float:right; margin-top:0px; margin-right:5px;
font-size:12px;color:white;
font-family:"Microsoft YaHei",微软雅黑;
}
.menu{ 
width:90%; height:90%;float:right; margin-top:0px; margin-right:5px;
font-size:16px;color:white;
font-family:"Microsoft YaHei",微软雅黑;
}
.menu li{ margin:10px;padding:0px 1.3em 0px 1.3em;height:40px;}
#top ul li{ color:#fff; float:left;}
.red{color:#900;}
.red a,.red a:visited{color:#900; text-decoration:none;}
.red a:hover{color:red; text-decoration:underline;}
.blue{color:#006;}
a:link{text-decoration:none;color:#ffffff;}
a:hover{text-decoration:none;color:#ffffff;}
a:visited{text-decoration:none;color:#ffffff;}
#bottomId span{
	margin-left:10px;
}
</style>
<script type="text/javascript" src="../extjs-4.1.0/ext-all.js"></script>
<script type="text/javascript" src="../js/head.js"></script>
<script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="../js/i18n.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#loginLogo").attr("src","../images/logo/"+domainCode+"/logo.png");
	setInterval(autoTask, 300000);
});	

function autoTask() {
	$.ajax({
		async : false,
		type : "get",
		url : path + '/monitoring/monitor!getAlarmMessageCount.action',
		dataType : 'json',
		success : function(response) {
			if (response.success) {
				$("#alarm_message").text(response.resultObject);
			}
		},
		error : function(XMLHttpRequest) {
			redirectLogin(XMLHttpRequest);
		}
	});	
}

  var indexId;
  var indexName;
  Ext.onReady(function(){
		var params;
    MultiLang = (function() {
        return {
            init: function() {
                // load ExtJS locale
                params = getCookie("lang");
                i18n.set({
  				  lang: params, 
  				  path: '../resources'
  				});
                if (params) {
                    var url = Ext.util.Format.format('../extjs-4.1.0/locale/ext-lang-{0}.js', params);
                    Ext.Ajax.request({
                        url: url,
                        success: this.onLoadExtLocaleSuccess,
                        failure: this.onLoadExtLocaleFailure,
                        scope: this
                    });
                } else {
                    // no language found, locale of ExtJS will be english as default
                    //this.loadmyprojectLocale();
                	this.setup();
                }
            },
            onLoadExtLocaleSuccess: function(response) {
                try {
                    eval(response.responseText);
                } catch (e) {
                    //Ext.Msg.alert('Failure', e.toString());
                }
                //this.loadmyprojectLocale();
                this.setup();
            },
            onLoadExtLocaleFailure: function() {
                //Ext.Msg.alert('Failure', 'Failed to load locale file.');
                this.setup();
                //this.loadmyprojectLocale();
            },
            setup: function() {	
			   
    	Ext.Ajax.request({
    		url: path+'/admin_mgmt/adminManagement!getSessionUser.action',
    	    success: function(response){
    	    	var obj = Ext.decode(response.responseText);
    	    	if(obj.success){
    	    		//document.getElementById('CurrentUser').innerHTML =obj.resultObject.name;
    	    	}
    	        
    	    }
    	});     	
		
  

	Ext.create('Ext.Viewport',{
		layout:'border',
	    defaults:{
			     split:true
			  }, 
		items:[
		{
		   region:'north',
		   xtype:'panel',
		   layout:'fit',
		  // height:78,
		   width:'100%',
		   items:[
		   {
        xtype: 'component',
        contentEl:'top'
          }]
		},//top
		{
		id:'main',
		region:'center',
		xtype:'panel',
		layout:'fit',
		width:'100%',
		items:[{
		   xtype:'component',
		   layout:'fit',
    	   autoEl:{
				tag:'iframe',
				name:'iframe',
				frameborder:'0px'
			}
		}]
 	   },
 	  	{
		   region:'south',
		   xtype:'panel',
		   layout:'fit',
		   height:20,
           minHeight:20,
		   maxHeight:100,
		   items:[
		   {
	        xtype: 'component',
	        contentEl:'bottomId'
          }]
		}
	  ]
	})//页面布局
	    //document.getElementById("wel").innerHTML=i18n._('welcome');
	    document.getElementById("exit").innerHTML=i18n._('exit');

        var lang = getCookie("lang");

		if(lang=="zh_CN"||lang=="zh-cn"){
		      var today=new Date; 
              var week=new Array(7); 
              week[0]="天"; 
              week[1]="一"; 
              week[2]="二"; 
              week[3]="三"; 
              week[4]="四"; 
              week[5]="五"; 
              week[6]="六"; 
			  //document.getElementById("date").innerHTML=today.getFullYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日 星期"+week[today.getDay()]+"";
			 
			 }else{
			    var today=new Date;
			    var day; var date1; 
			    if(today.getDay()==0) day = "Sunday" 
			    if(today.getDay()==1) day = "Monday " 
			    if(today.getDay()==2) day = "Tuesday" 
			    if(today.getDay()==3) day = "Wednesday" 
			    if(today.getDay()==4) day = "Thursday" 
			    if(today.getDay()==5) day = "Friday" 
			    if(today.getDay()==6) day = "Saturday "

			    if((today.getMonth() + 1 )==1) date1 = "Jan." 
			    if((today.getMonth() + 1 )==2) date1 = "Feb." 
			    if((today.getMonth() + 1 )==3) date1 = "Mar." 
			    if((today.getMonth() + 1 )==4) date1 = "Apr." 
			    if((today.getMonth() + 1 )==5) date1 = "May" 
			    if((today.getMonth() + 1 )==6) date1 = "Jun." 
			    if((today.getMonth() + 1 )==7) date1 = "Jul." 
			    if((today.getMonth() + 1 )==8) date1 = "Aug." 
			    if((today.getMonth() + 1 )==9) date1 = "Sep." 
			    if((today.getMonth() + 1 )==10) date1 = "Oct." 
			    if((today.getMonth() + 1 )==11) date1 = "Nov." 
			    if((today.getMonth() + 1 )==12) date1 = "Dec.";
			    date1 =day+"&nbsp;&nbsp;"+date1 +"&nbsp;"+ today.getDate() +",&nbsp;" + today.getFullYear();
				//document.getElementById("date").innerHTML=date1+" ";//
			 }
		var regionCodeStore = Ext.create('Ext.data.Store',{
		  	autoLoad: false,
		  	fields:['id','name','regionCode','description','code'],
		  	proxy:new Ext.data.proxy.Ajax({
		  		url : path+'/sc/zoneGroup!getAllZoneGroups.action',
		  		reader: {
		            type: 'json',
		  			root:'resultObject',
		  			totalProperty: 'resultObject.totalCount'
		          }
		  	}),
		  	listeners : {
		  		load : function(regionCodeStore, records, successful, eOpts ){
		  			if(successful && regionCodeStore.getCount()>0){
		  				Ext.Ajax.request({
		  					url: path + '/admin_mgmt/basicData!getRegionCodeFromThreadLocal.action',
		  					method: 'GET',
		  					reader: {
		  						type: 'json',
		  			  			root:'resultObject',
		  			  			totalProperty: 'resultObject.totalCount'
		  					},
		  					success:function(threadloaclData){
		  						var respText = Ext.decode(threadloaclData.responseText);
		  						var regionCode = respText.resultObject['regionCode'];
		  						for(var int = 0;int < regionCodeStore.data.items.length;int++){
		  							if(regionCodeStore.getAt(int).get('regionCode') == regionCode){
										var name = regionCodeStore.getAt(int).get('name')
		  							}
		  						}
		  						regionCodeComb.setRawValue(name);
		  					}
		  				})
		  			}
		  		}
		  	}
		  });
		
		var regionCodeComb = Ext.create('Ext.form.ComboBox',{
			id:'regionSelect',
		  	width : 100,
		  	listConfig:{maxHeight:200},
		  	editable : false,
		  	allowBlank:false,
 			forceSelection: true,
 			allowBlank:false,
		  	store : regionCodeStore,
		  	displayField : 'name',
 		  	valueField : 'regionCode',
		  	renderTo: 'region_select',
		  	forceSelection:true,
		  	listeners:{
		  		'select': {
		  			fn: function(){
		  				Ext.Ajax.request({
		  					url: path + '/admin_mgmt/basicData!setRegionToThreadLocal.action',
		  					method : 'POST',
		  					jsonData: {'regionCode':regionCodeComb.getValue()},
		  					success: function(form, action){
		  						var obj = Ext.decode(form.responseText);
								if (obj == null || obj.success == null) {
									Ext.MessageBox.show({
										title : i18n._('errorNotice'),
										msg : i18n._('returnNull'),
										buttons : Ext.MessageBox.OK,
										icon : Ext.MessageBox.ERROR
									});// INFO,QUESTION,WARNING,ERROR
									return;
								}
								if (!obj.success) {
									Ext.MessageBox.show({
										title : i18n._('errorNotice'),
										msg : obj.resultMsg,
										buttons : Ext.MessageBox.OK,
										icon : Ext.MessageBox.ERROR
									});
									return;
								}
								document.getElementsByTagName('iframe')[0].contentDocument.location.reload();
		  					}
		  				})
		  			}
		  		},
		  		scope: this
		  	}
		});
		regionCodeStore.load();
}
        };
    })();
    
    
    MultiLang.init();
    menuPrivilege();
    var copyRight={
    		data:'',
    		context:new Array(),
    		load:function(domainCode){
    			$.ajax({
    				url : path+'/admin_mgmt/userManagement!readCopyright.action?domainCode=' +domainCode,
    				type: 'GET',
    				dataType: 'json',
    				contentType: "application/json; charset=utf-8",
    				success: function(data){
    					if(data.success == true) {
    						copyRight.data=data.resultObject;
    						copyRight.context.push(data.resultObject['zh_CN']);
    						copyRight.context.push(data.resultObject['en_US']);
    						copyRight.renderPage(Ext.util.Cookies.get("lang"));
    					} else {
    						alert(data.resultMsg);
    					}
    				}
    			});
    		},
    		renderPage:function(currentLang){
    			var context = copyRight.data[currentLang];
    			if(currentLang=='zh_CN'){
    				context = copyRight.context[0];
    			}else{
    				context = copyRight.context[1];
    			}
    			$('#copyright').html(context);
    		}
    	};
    
    copyRight.load(domainCode);
})

           	var v_mask = null;
           	//告警信息列表Model
           	var alarmMessageModel = Ext.define('alarmMessageModel', {
           		extend : 'Ext.data.Model',
           		fields : [
						   {name:'id'},
						   {name:'alarm_time',mapping: 'alarm_time', type: 'date', dateFormat: 'time'},
						   {name:'alarm_type'},	   
						   {name:'alarm_content'},	   
						   {name:'alarm_level'},	   
						   {name:'alarm_receiver'},	   
						   {name:'is_readed'}            		
           		          ]
           	});
           	//告警信息列表Store
           	var alarmMessageStore = Ext.create('Ext.data.Store', {
           		model : 'alarmMessageModel',
           		autoLoad : true,//true
           		pageSize : pageSize,//每页显示16条数据
           		sorters : [ {
           			property : 'id',
           			direction : 'DESC'
           		} ],
           		//remoteSort : true,
           		proxy : new Ext.data.proxy.Ajax({
           			//type : 'ajax',
           			url : path + '/monitoring/monitor!findAlarmMessagePage.action',
           			reader : {
           				type : 'json',
           				root : 'resultObject.result',
           				totalProperty : 'resultObject.totalCount'
           			},
           			listeners:{
           				exception:function(reader, response, error, eOpts){
           					ajaxException(reader, response, error, eOpts );
           				}
           			}
           		}),	
           		listeners : {
           			beforeload : function(store,operation, eOpts ){	
           				//遮罩层
           				v_mask = new Ext.LoadMask(Ext.getBody(), {
           					msg : i18n._('please wait'),
           					removeMask : true			
           				});
           				v_mask.show();
           			},
           			load : function(store, records, successful, eOpts ){
           				v_mask.hide();
           			}
           		}
           	});
           	
           	//删除后刷新页面
           	function afterDeleteLater() {
           	    var count = alarmMessageStore.data.length;
           	    var total = alarmMessageStore.getTotalCount();
           	    if(total != 1 && count == 1) {
           	    	alarmMessageStore.previousPage();
           	    } else {
           	    	alarmMessageStore.load();
           	    }
           	}	            	

function showAlarmMessageWin() {
  Ext.onReady(function(){
		var params;
    MultiLang = (function() {
        return {
            init: function() {
                // load ExtJS locale
                params = getCookie("lang");
                i18n.set({
  				  lang: params, 
  				  path: '../resources'
  				});
                if (params) {
                    var url = Ext.util.Format.format('../extjs-4.1.0/locale/ext-lang-{0}.js', params);
                    Ext.Ajax.request({
                        url: url,
                        success: this.onLoadExtLocaleSuccess,
                        failure: this.onLoadExtLocaleFailure,
                        scope: this
                    });
                } else {
                    // no language found, locale of ExtJS will be english as default
                    //this.loadmyprojectLocale();
                	this.setup();
                }
            },
            onLoadExtLocaleSuccess: function(response) {
                try {
                    eval(response.responseText);
                } catch (e) {
                    //Ext.Msg.alert('Failure', e.toString());
                }
                //this.loadmyprojectLocale();
                this.setup();
            },
            onLoadExtLocaleFailure: function() {
                //Ext.Msg.alert('Failure', 'Failed to load locale file.');
                this.setup();
                //this.loadmyprojectLocale();
            },
            setup: function() {	

	            	//分页序号
	            	Ext.grid.PageRowNumberer = Ext.extend(Ext.grid.RowNumberer, { 
	            		baseCls:Ext.baseCSSPrefix + 'column-header ' + Ext.baseCSSPrefix + 'unselectable',
	            		cls:Ext.baseCSSPrefix + 'row-numberer',
	            		tdCls:Ext.baseCSSPrefix+"grid-cell-special",
	            	    renderer:function(value, cellmeta, record, rowIndex, columnIndex, store){   
	            	        return (store.currentPage - 1) * store.pageSize + rowIndex + 1;  
	            	    }       
	            	});
	            	
	            	//删除后刷新页面
	            	function afterDelete() {
	            	    var count = alarmMessageStore.data.length;
	            	    var total = alarmMessageStore.getTotalCount();
	            	    if(total != 1 && count == 1) {
	            	    	alarmMessageStore.previousPage();
	            	    } else {
	            	    	alarmMessageStore.load();
	            	    }
	            	}
	            	
	            	var alertGrid=Ext.create('Ext.grid.Panel', {
	            	    layout:'fit',            		
	            	    store:alarmMessageStore,
	            		simpleSelect:true,
	            		selModel: Ext.create('Ext.selection.RowModel'),
	            	    columns: [
									Ext.create('Ext.grid.PageRowNumberer',{flex : 0.1}),
									{
										header: i18n._('Id'),
										dataIndex:'id',
										flex:0.1,
										hidden:true
									},
									{
										header: i18n._('alarm_time'),
										dataIndex:'alarm_time',
										sortable: false,
										flex:0.4,
										renderer: Ext.util.Format.dateRenderer("Y-m-d H:i:s")
									},
									{
										header: i18n._('alarm_type'), //告警类型
										dataIndex: 'alarm_type',
										sortable: false,
										flex:0.5,
										renderer:function(value){
											if(value== '1'){
												return i18n._('ip_resource_is_not_enough');
											}else if(value== '2'){
												return i18n._('cpu_resource_is_not_enough');
											}else if(value== '3'){
												return i18n._('memory_resource_is_not_enough');
											}else if(value== '4'){
												return i18n._('store_resource_is_not_enough');
											}
										}
									},
									{
										header: i18n._('alarm_content'), //告警内容
										dataIndex: 'alarm_content',
										sortable: false,
										flex:0.5
									},
									{
										header: i18n._('Operating'), //操作
										dataIndex: 'is_readed',
										sortable: false,
										flex:0.5,
										renderer : renderOperationStatus
									}
	            		],
	            		bbar: Ext.create('Ext.toolbar.Paging', {
	            	          store:alarmMessageStore,
	            	          displayInfo: true,
	            	          beforePageText:i18n._('beforePageText'),//"第"
	            	          firstText: i18n._('firstText'),//"第一页"
	            	          prevText: i18n._('prevText'),//"上一页"
	            	          nextText: i18n._('nextText'),//"下一页"
	            	          lastText: i18n._('lastText'),//"最后页"
	            	          refreshText: i18n._('refreshText')//"刷新"
	            	    }),           	
	            	    viewConfig: {
	            	    	stripeRows: true
	            	    },            		
	            		dockedItems:[
	            		{
	            			xtype:'toolbar',
	            			cls: 'toolbarCSS',
	            			dock: 'top',			
	            			items:[
			            			{                				   
			            				xtype : 'button',									
			        					text: '<font id="set_all_as_read" color="#ffffff" >' + i18n._('set_all_as_read') + '</font>',//设为已读
			        					listeners: {
			        						 "mouseout" : function() {
			        							 document.getElementById("set_all_as_read").style.color = "white";
			        						 },
			        						 "mouseover" : function() {
			        							 document.getElementById("set_all_as_read").style.color = "black";
			        						 }
			        							
			        					},
			        					icon : 'images/del.png',
			            				handler:function(){
			            					// 删除全部告警
			        						var rows = alertGrid.getSelectionModel().getSelection();
			        						var Id;
			        						//if (rows.length > 0) {
			        						//	Id = rows[0].get('id');
	                                            Ext.Ajax.request({
	      											url: path + '/monitoring/monitor!setAllAlarmMessageAsRead.action',
	      											method: 'POST',
	      											//params:{
	      											//	'id': Id
	      											//},
	      											success: function (response) {
	      												var result=Ext.JSON.decode(response.responseText);
	      												if(result.success==true){　　　　　　　
	      													Ext.MessageBox.show({
	      														title : i18n._('notice'),
	      														msg : i18n._('Operating')+i18n._('Successful'),
	      														icon : Ext.MessageBox.INFO,
	      														buttons : Ext.MessageBox.OK,
	      														fn: afterDelete
	      													});																							
	      												}else{
	      													Ext.MessageBox.show({
	      														title : i18n._('notice'),
	      														msg : result.resultMsg,
	      														icon : Ext.MessageBox.INFO,
	      														buttons : Ext.MessageBox.OK
	      													});
	      													return;
	      												}
	      											//	alertStore.load();
	      											}
	      										});
			        						//} else {
			        						//	Ext.MessageBox.show({
			        						//		title : i18n._('Prompt'),
			        						//		msg : i18n._('selectOne'),
			        						//		icon : Ext.MessageBox.INFO,
			        						//		buttons : Ext.MessageBox.OK
			        						//	});
			        						//	return;
			        						//}		
			            				}            	   
			            			},            			
	            					{xtype:'tbfill'}
	            				]
	            		}]
	            	});
	            	function reLoadData(){
	            		alarmMessageStore.load();
	            	}
	            	
				      //添加资源警告类型，没有数据库加载
			          Ext.data.t = [[1,i18n._('ip_resource_is_not_enough')],
			                        [2,i18n._('cpu_resource_is_not_enough')],
			                        [3,i18n._('memory_resource_is_not_enough')],
			                        [4,i18n._('store_resource_is_not_enough')]];
		              var alarm_type_store = new Ext.data.SimpleStore({ 
		                  fields: ['id', 'name'],
		                  data:Ext.data.t 
		              });			      		      
	                
					//所有弹出窗
					var alarm_messageWin = Ext.create('Ext.window.Window', {
						width : 1000,
						height : 500,
						closable : false,
						constrain : true,
						modal : true,
						tools : [ {
							type : 'close',
							handler : function() {
								alarm_messageWin.hide();
							}
						} ],
						layout : 'fit',
						defaults : {
							split : false
						},
						items : [
					               {
					                 xtype:'panel',
					                 layout:'fit',
					                 autoScroll:true,
					                 items:alertGrid
					              } ]
					}); 
					alarm_messageWin.show();   	                     
            }
        };
    })();
    MultiLang.init();
    });
} 

//渲染操作状态
function renderOperationStatus(value, cellmeta, record, rowIndex, columnIndex, store) {
	var id = store.getAt(rowIndex).get('id');
	var is_readed = store.getAt(rowIndex).get('is_readed');
 	if(is_readed == false){
 		var str = '<a href ="javascript:void(0)" style="text-decoration: none;color: blue;" onclick=set_as_read('+id+')>'+i18n._('set_as_read')+'</a>';
 		return str;
 	}
};

function set_as_read(id) {
    Ext.Ajax.request({
		url: path + '/monitoring/monitor!setAlarmMessageAsRead.action',
		method: 'POST',
		params:{
			'id': id
		},
		success: function (response) {
			var result=Ext.JSON.decode(response.responseText);
			if(result.success==true){　　　　　　　
				Ext.MessageBox.show({
					title : i18n._('notice'),
					msg : i18n._('Operating')+i18n._('Successful'),
					icon : Ext.MessageBox.INFO,
					buttons : Ext.MessageBox.OK,
					fn: afterDeleteLater
				});																							
			}else{
				Ext.MessageBox.show({
					title : i18n._('notice'),
					msg : result.resultMsg,
					icon : Ext.MessageBox.INFO,
					buttons : Ext.MessageBox.OK
				});
				return;
			}
		//	alertStore.load();
		}
	});
}


 function getCookie(name){
         var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
         if(arr != null) return unescape(arr[2]);
		 return null;
 }
  //加载菜单
  function menuPrivilege(){
        Ext.Ajax.request(  {
            url: path+'/admin_mgmt/menu!getAdminMenu.action',
            params:{
                "parentId": "0"
            },
            success:function(response){
                var obj = Ext.decode(response.responseText);
                var menuList = new Ext.JSON.decode(response.responseText);
                var result = '';
                if(menuList != null && menuList.length > 0) {
                    for(var i = 0; i< menuList.length; i++) {
                        result += assemble_li(menuList[i].url, menuList[i].name, menuList[i].id,menuList[i].icon);
                    }
                    $('.menu').html(result);
                      
                    indexId = menuList[0].id;
                    indexName = menuList[0].name;
                    var iconFirst=menuList[0].icon.split(";");
                    delayLoad(menuList[0].url,iconFirst[1]);
                 //     document.getElementsByTagName('iframe')[0].src=menuList[0].url;
                 }
                 return;
             }}
      );
  }
  var t; //延时对象
  //延时加载
  function delayLoad(url,icon) {
	  if(document.getElementsByTagName('iframe')[0] == null 
			  || document.getElementsByTagName('iframe')[0] == 'undefined') {
		  t = setTimeout("delayLoad('" + url + "')", 200);
	  } else {
		  clearTimeout(t);
		  document.getElementsByTagName('iframe')[0].src=url;		 
		$(".menu li:first-child").children().children().attr('src', icon);
		$(".menu li:first-child").children().css("color","#ee8800");
		  //Ext.getCmp('main').getLoader().load();
	  }
  }

  function userlogout(){

      var path = '../user_mgmt/logout.action';
      Ext.Ajax.request({
          url:path,
          success: function(response){
                  if(response.status == 200){
                      document.location.href="../hc_admin_login.html";
                  }else{
                      Ext.MessageBox.show({
                          title: i18n._("notice"),
                          msg: obj.resultMsg,
                          icon:Ext.MessageBox.INFO,
                          buttons: Ext.MessageBox.OK

                      });
                      return;
                  }
              }
      });
  }
  
  function userlogout(){
      var path = '../admin_mgmt/adminManagement!logout.action';
      Ext.Ajax.request({
          url:path,
          success: function(response){
                  if(response.status == 200){
                      document.location.href="../index.html";
                  }else{
                      Ext.MessageBox.show({
                          title: i18n._("notice"),
                          msg: obj.resultMsg,
                          icon:Ext.MessageBox.INFO,
                          buttons: Ext.MessageBox.OK

                      });
                      return;
                  }
              }
      });
  }
  
  function linkIframe(obj, url, id, name,icon) {
	  //$(".menu li").each(function(){
		//  $(this).css('background-image', 'none');
		  //$(this).css('background-repeat', 'no-repeat');
		  //$(this).css('background-position', 'center top');
	  //});
	  //$(obj.parentNode).css('background-image', 'url(../images/menuLine.png)');
	  $(".menu li img").each(function(){
		  var newSrc=$(this).attr("src").replace("2","1");
		  $(this).attr("src",newSrc);
	  });
	  $(".menu li a").each(function(){
		  $(this).css("color","#fff");
	  });
	  $(obj).children().attr("src",icon);
	  $(obj).css("color","#ee8800");
	  indexId = id;
	  indexName = name;
	  document.getElementsByTagName('iframe')[0].src=url;
  }
  
  //组装li
  function assemble_li(url,  name, id,icon) {
	  var srcArray=icon.split(";");
	  if(srcArray != null && srcArray.length>1){
		  return '<li><a href="#" onclick="linkIframe(this, \'' + url + '\', \'' + id + '\', \'' + name + '\', \'' + srcArray[1] + '\');"  ><img alt="logo" src="'+srcArray[0]+'" style="vertical-align:top;cursor:pointer;">' + i18n._(name) + '</a></li>' 
	  }else{
		  return '<li style="margin:25px auto 0px auto;height:40px;vertical-align:center;"><a href="#" onclick="linkIframe(this, \'' + url + '\', \'' + id + '\', \'' + name + '\');"  >' + i18n._(name) + '</a></li>'
	  }
	  
  }
  
  
</script>
</head>
<body>
<!-- Save for Web Slices (主页.psd) -->
<table id="top" style="width:100%">	
	<tr>
		<td style="border:none">
			<!-- <table style="background-image: url('../images/head/banner_bg.png');width:100%;height:72px;border:none"> -->
			<table style="background: #2c2c2c;width:100%;height:72px;border:none">
				<tr>
					<td style="width:1%;">
					</td>
					<td style="vertical-align:top;width:10%;padding-top:5px;">
						<img id="loginLogo" src="" style="height:58px;width:128px;"/><!-- <img alt="logo" src="../images/head/logo_head.png"> -->
					</td>
					<td style="width:65%;">
						<ul class="menu">		          		
			          	</ul>
					</td>
					<td id="menuTdId" style="width:18%;">
						<ul class="info">
						<li style="padding:0px 1em 0px 1em;">
							<div id="region_select"></div>
						</li>
			              <li style="padding:0px 1em 0px 1em;">
			              	<a onclick="showAlarmMessageWin()" href="#" style="text-decoration:none;color:white">
			              		<img alt="" src="../images/head/ring.png" style="vertical-align:text-bottom;">&nbsp;<span id="alarm_message" >0</span>
			              	</a>
					      </li>
			              <li style="padding:0px 2em 0px 1em;text-align:right">
			              	<!-- <span id="wel"></span>&nbsp;&nbsp;
			              	<span class="blue" id="CurrentUser" style="color:white;"></span>&nbsp;&nbsp; -->
			              	<a href="#" style="text-decoration:none;color:white" onclick="userlogout();">
			              		<span id="exit"></span>
			              		<img alt="" src="../images/head/exit_orange.png" style="vertical-align:text-bottom;">
			              	</a>
			              </li>
			          	</ul>			          	
					</td>				
				</tr>				
			</table>
		</td>
		<!-- <td background= "../images/head/index_03.png" width="6" height="65">
			</td> -->
		
	</tr>
</table>
<!-- <table id="top" width="100%">
	
	<tr>
		<td background= "../images/head/index_03.png" width="6" height="65">
			</td>
		<td background= "../images/head/index_04.png" width="22" height="65">
			</td>
		<td background= "../images/head/index_05.png" width="130" height="65">
			</td>
		<td height="65"  background= "../images/head/index_06.png" id="menuTdId">
			<ul class="info">
              <li style="width:300px;" id="date">
		      </li>
              <li style="padding-right:100px;text-align:right"><span id="wel"></span>&nbsp;&nbsp;<span class="blue" id="CurrentUser" style="color:white;"></span>&nbsp;&nbsp;<a href="#" style="text-decoration:none;color:white" onclick="userlogout();">&nbsp;&nbsp;<span id="exit"></span></a></li>
          	</ul>
          	<ul class="menu">
          		
          	</ul>
		</td>
	</tr>
</table> -->
<!-- End Save for Web Slices -->
<div id="bottomId" style="background-color:#f0f0f0;height:100%;font-color:#707070;font-size:10pt;font-family:Arial;" align="left" >
	<span id="copyright">© 2015 中铁信</span>
</div>
</body>
</html>
